﻿using System.Collections.Generic;
using System.ComponentModel;
using Common;
using Common.ParameterLocator;
using Microsoft.VisualStudio.Shell;

namespace Microsoft.SpecFlowTfsLinker_Extension
{
    public class VisualStudioParameter : DialogPage
    {
        private string _tfsServerUrl = DefaultParameter.TfsServerUrl;
        [Category("TFS Parameters")]
        [DisplayName(@"Server Name")]
        [Description("The URL of your TFS Server")]
        public string TfsServerUrl
        {
            get { return _tfsServerUrl; }
            set { _tfsServerUrl = value; }
        }

        private string _tfsUsernameServer = DefaultParameter.TfsUserNameConnexion;
        [Category("TFS Parameters")]
        [DisplayName(@"Username Server Connexion")]
        [Description("The username to connect to TFS (Leave blank if Window Integrated)")]
        public string TfsUsernameServer
        {
            get { return _tfsUsernameServer; }
            set { _tfsUsernameServer = value; }
        }

        private string _tfsPasswordServer = DefaultParameter.TfsPasswordConnexion;
        [Category("TFS Parameters")]
        [DisplayName(@"Password Server Connexion")]
        [Description("The password to connect to TFS (Leave blank if Window Integrated)")]
        public string TfsPasswordServer
        {
            get { return _tfsPasswordServer; }
            set { _tfsPasswordServer = value; }
        }

        private string _tfsQueryUserStory = DefaultParameter.TfsQueryUserStory;
        [Category("TFS Parameters")]
        [DisplayName(@"User Story Query")]
        [Description("the TFS Query to retrieve to User Story")]
        public string TfsQueryUserStory
        {
            get { return _tfsQueryUserStory; }
            set { _tfsQueryUserStory = value; }
        }

        private string _tfsWorkitemType = DefaultParameter.TfsWorkitemType;
        [Category("TFS Parameters")]
        [DisplayName(@"Work Item Type")]
        [Description("The type of Item represented in TFS for a User Story")]
        public string TfsWorkitemType
        {
            get { return _tfsWorkitemType; }
            set { _tfsWorkitemType = value; }
        }

        private string _formatParameter = DefaultParameter.FormatParameter;
        [Category("SpecFlow Method Parameters")]
        [DisplayName(@"Format Parameter")]
        [Description("Represent the replacement statement for a parameter")]
        public string FormatParameter
        {
            get { return _formatParameter; }
            set { _formatParameter = value; }
        }

        private string _folderName = DefaultParameter.FolderName;
        [Category("Visual Studio Add-in parameters")]
        [DisplayName(@"Generated folder Name")]
        [Description("The format of the generated Specflow folder in the Visual Studio solution")]
        public string FolderName
        {
            get { return _folderName; }
            set { _folderName = value; }
        }

        private string _formatDisplayParameter = DefaultParameter.FormatDisplayParameter;
        [Category("SpecFlow Method Parameters")]
        [DisplayName(@"Display Parameter Format")]
        [Description("The format for the parameter in the SpecFlow Method")]
        public string FormatDisplayParameter
        {
            get { return _formatDisplayParameter; }
            set { _formatDisplayParameter = value; }
        }

        private string _inconclusiveMessage = DefaultParameter.InconclusiveMessage;
        [Category("SpecFlow Method Parameters")]
        [DisplayName(@"Inconclusive Message")]
        [Description("The inconclusive message displayed in each non implement generated method")]
        public string InconclusiveMessage
        {
            get { return _inconclusiveMessage; }
            set { _inconclusiveMessage = value; }
        }

        private string _regexFindParameter = DefaultParameter.RegexFindParameter;
        [Category("Regex")]
        [DisplayName(@"Find Parameter Regex")]
        [Description("The regex used to extract parameters")]
        public string RegexFindParameter
        {
            get { return _regexFindParameter; }
            set { _regexFindParameter = value; }
        }

        private string _regexCleanStatement = DefaultParameter.RegexCleanStatement;
        [Category("Regex")]
        [DisplayName(@"Clean statement Regex")]
        [Description("The regex used to clean each statement")]
        public string RegexCleanStatement
        {
            get { return _regexCleanStatement; }
            set { _regexCleanStatement = value; }
        }

        private string _regexFindStatement = DefaultParameter.RegexFindStatement;
        [Category("Regex")]
        [DisplayName(@"Find statement Regex")]
        [Description("The regex used to find each statement")]
        public string RegexFindStatement
        {
            get { return _regexFindStatement; }
            set { _regexFindStatement = value; }
        }

        private List<ReplaceElement> _textReplacement = DefaultParameter.TextReplacement;
        [Category("Text Replacment")]
        [DisplayName(@"Replace test")]
        [Description("Replace word or char to another")]
        public List<ReplaceElement> TextReplacement
        {
            get { return _textReplacement; }
            set { _textReplacement = value; } 
        }
    }
}